package cn.itsource.course.doc;

import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.util.Date;

//indexName:定义索引库   type：相当于数据库中的表名(默认不分词，不打注解就不分词 )
@Document(indexName = "hrm", type = "courseDoc")
public class CourseDoc {
    @Id
    private Long id;
    //定义该字段不分词
    //课程的名字
    @Field(type = FieldType.Keyword)
    private String name;
    //适用的人群
    private String users;
    //等级名称
    private String gradeName;
    //机构的名称
    private String tenantName;

    private Date start_time;
    private Date end_time;
    //课程等级id
    private Long grade;
    /**
     * 收费规则，对应数据字典, 0免费，1收费
     */
    private String chargeName;
    /**
     * 咨询qq
     */
    private String qq;
    //优惠价
    private Float price;
    //原价
    private Float priceOld;
    //定义一个字段  要分词，并且分词采用ik分词器
//    @Field(type =FieldType.Text,analyzer = "ik_max_word",searchAnalyzer = "ik_max_word")
//    private String hobby;
    //简介
    private String intro;
    //上线时间
    private Date online;
    //销量
    private Integer buyCount;
    //评论
    private Integer comment;

    //课程类型
    private Long courseTypeId;

    public Long getCourseTypeId() {
        return courseTypeId;
    }

    public void setCourseTypeId(Long courseTypeId) {
        this.courseTypeId = courseTypeId;
    }

    public Integer getComment() {
        return comment;
    }

    public void setComment(Integer comment) {
        this.comment = comment;
    }

    public Integer getBuyCount() {
        return buyCount;
    }

    public void setBuyCount(Integer buyCount) {
        this.buyCount = buyCount;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getUsers() {
        return users;
    }

    public void setUsers(String users) {
        this.users = users;
    }

    public String getGradeName() {
        return gradeName;
    }

    public void setGradeName(String gradeName) {
        this.gradeName = gradeName;
    }

    public String getTenantName() {
        return tenantName;
    }

    public void setTenantName(String tenantName) {
        this.tenantName = tenantName;
    }

    public Date getStart_time() {
        return start_time;
    }

    public void setStart_time(Date start_time) {
        this.start_time = start_time;
    }

    public Date getEnd_time() {
        return end_time;
    }

    public void setEnd_time(Date end_time) {
        this.end_time = end_time;
    }

    public Long getGrade() {
        return grade;
    }

    public void setGrade(Long grade) {
        this.grade = grade;
    }

    public String getChargeName() {
        return chargeName;
    }

    public void setChargeName(String chargeName) {
        this.chargeName = chargeName;
    }

    public String getQq() {
        return qq;
    }

    public void setQq(String qq) {
        this.qq = qq;
    }

    public Float getPrice() {
        return price;
    }

    public void setPrice(Float price) {
        this.price = price;
    }

    public Float getPriceOld() {
        return priceOld;
    }

    public void setPriceOld(Float priceOld) {
        this.priceOld = priceOld;
    }

    public String getIntro() {
        return intro;
    }

    public void setIntro(String intro) {
        this.intro = intro;
    }

    public Date getOnline() {
        return online;
    }

    public void setOnline(Date online) {
        this.online = online;
    }
}
